package com.cn.wanxi.util;

import redis.clients.jedis.Jedis;

import java.beans.Transient;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

//@Config
public class MyTimer {
    @Transient
    private void openTimer() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                Jedis jedis = new Jedis();
                jedis.del("logo", "titles");
                Date date = new Date("2021/11/11");
                long haomiao = date.getTime();
                long now = System.currentTimeMillis();
                if (now > haomiao) {
                    timer.cancel();
                }
            }
        }, 60 * 60 * 24 * 1000, 60 * 60 * 24 * 1000);

    }
}
